package com.company.单例模式.优化后的懒汉模式;

public class Test {
    public static void main(String[] args) throws ClassNotFoundException {
        Class.forName("com.company.单例模式.优化后的懒汉模式.Instance");
        System.out.println("=======================");

//        for (int i=0;i<1000;i++){
//            new Thread(){
//
//                public void run() {
//                   Instance.getInstance();
//                }
//            }.start();
//        }
        Instance instance1 = Instance.getInstance();
        Instance instance2 = Instance.getInstance();

        System.out.println(instance1==instance2);
    }
}
